<?php
class action_license
{
	var $install;
	
	function action_license( & $install )
	{
		$this->install =& $install;
	}
	
	function run()
	{
	if( $this->install->mainClass->input['sub'] == 'check' )
		{
		if($this->install->mainClass->input['lice_1'] == '' || $this->install->mainClass->input['lice_2'] == '' || $this->install->mainClass->input['lice_3'] == '' || $this->install->mainClass->input['lice_4'] == '' )
				{
					$errors[] = 'Please fill in the entire license code';
				}
	if( is_array( $errors ) )
			{
				$this->install->template->warning( $errors );	
			}
			else 
			{
				/* Save Form Data */
				$this->install->saved_data['lice_1']  = $this->install->mainClass->input['lice_1'];
				$this->install->saved_data['lice_2'] = $this->install->mainClass->input['lice_2'];
				$this->install->saved_data['lice_3'] = $this->install->mainClass->input['lice_3'];
				$this->install->saved_data['lice_4'] = $this->install->mainClass->input['lice_4'];

				/* Next Action */
				$this->install->template->page_current = 'settings';
				$this->install->mainClass->input['sub'] = '';
				require_once( INS_ROOT_PATH . 'core/actions/settings.php' );	
				$action = new action_settings( $this->install );
				$action->run();
				return;				
			}
		}
		/* Page Output */
		$this->install->template->append( $this->install->template->license_page( ) );
		$this->install->template->next_action = '?p=license&sub=check';
	}
}

?>